/*
 * @Author: your name
 * @Date: 2021-02-16 17:29:04
 * @LastEditTime: 2021-02-16 18:05:20
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \jianfa-api\dao\staCallDao.js
 */
const { querySql } = require('../db')
const moment = require('moment')
moment.locale("zh-cn");
module.exports = {
 // 增加一条访问记录
 async callDao({ip ,create_time}) {
  const sql = `insert into total (ip_address, create_time) values ('${ip}' , '${create_time}')`
  return await querySql(sql)
 },
 //获取统计信息
 async getTotalDao() {
  console.log('object :>> ', moment().format('MM月D日'));
  // const sql = `select create_time from total where create_time between '2021年02月16日 5:42:51' and '2021年02月16日 5:57:21'`
  const sql = `select create_time from total`
  return await querySql(sql)
 },
}